"use strict";

const Controller = require("egg").Controller;

class QueryTypeNameByIdController extends Controller {
  // get请求
  async index() {
    try {
      let res = await this.ctx.service.commodity.queryTypeNameById();

      this.ctx.body = {
        code: 200,
        data: res
      };
    } catch (e) {
      console.log(e);
      this.ctx.body = {
        code: 500,
        data: {
          msg: "服务器错误"
        }
      };
    }
  }
}

module.exports = QueryTypeNameByIdController;
